<html>
<pre>
	
</pre>
<body>
	<h1>Alchemy Examples</h1>

	<p id="name"> </p>
	<p id="concepts"> </p>

	<script type="text/javascript" src="jquery-1.6.2-min.js"></script>
	<script type="text/javascript" src="http://wing.comp.nus.edu.sg/~huydhn/sciverse/json2.js"></script>
	<script type="text/javascript" src="http://wing.comp.nus.edu.sg/~huydhn/sciverse/cors.js"></script>
	<script type="text/javascript" src="http://wing.comp.nus.edu.sg/~huydhn/sciverse/alchemy.js"></script>
	<script type="text/javascript">
		var key = "af8f82243d6d599ff29135e33f78514555f576cf";
		var author = "Edward P. Havranek MD, FACC*, , , Ignatius Thomas MD†, William B. Smith MD‡, George A. Ponce MD§, Martin Bilsker MD, FACC, Mark A. Munger, PharmD¶, Robert A. Wolf MD, FACC# and for the Irbesartan Heart Failure Group";
		// This is the content of the article
		var content =	'Abstract\n' + 'OBJECTIVES\n' +
						'The primary purpose of this study was to determine the acute and long-term hemodynamic and clinical effects of irbesartan in patients with heart failure.\n' +
						'BACKGROUND\n' +
						'Inhibition of angiotensin II production by angiotensin-converting enzyme (ACE) inhibitors reduces morbidity and mortality in patients with heart failure. Irbesartan is an orally active antagonist of the angiotensin II AT1 receptor subtype with potential efficacy in heart failure.\n' +
						'METHODS\n' +
						'Two hundred eighteen patients with symptomatic heart failure (New York Heart Association [NYHA] class II–IV) and left ventricular ejection fraction ≤40% participated in the study. Serial hemodynamic measurements were made over 24 h following randomization to irbesartan 12.5 mg, 37.5 mg, 75 mg, 150 mg or placebo. After the first dose of study medication, patients receiving placebo were reallocated to one of the four irbesartan doses, treatment was continued for 12 weeks and hemodynamic measurements were repeated.\n' +
						'RESULTS\n' +
						'Irbesartan induced significant dose-related decreases in pulmonary capillary wedge pressure (average change −5.9 ± 0.9 mm Hg and −5.3 ± 0.9 mm Hg for irbesartan 75 mg and 150 mg, respectively) after 12 weeks of therapy without causing reflex tachycardia and without increasing plasma norepinephrine. The neurohormonal effects of irbesartan were highly variable and none of the changes was statistically significant. There was a significant dose-related decrease in the percentage of patients discontinuing study medication because of worsening heart failure. Irbesartan was well tolerated without evidence of dose-related cough or azotemia.\n' +
						'CONCLUSIONS\n' +
						'Irbesartan, at once-daily doses of 75 mg and 150 mg, induced sustained hemodynamic improvement and prevented worsening heart failure.\n';

		// Call the alchemy service
		alchemyNameRecognition (key, author, processName);	
		// Call the alchemy service
		//alchemyConceptTagging(key, content, processConcept);	
		// Call the alchemy service
		//alchemyTopicExtraction(key, url, processTopic);

		function processTopic (data) {
			var json = JSON.parse(data);
		}

		function processConcept (data) {
			var json = JSON.parse(data);
			var concepts = new Array();
				
			var s = new String();
			for (var k in json[ 'concepts' ]) {
				concepts.push(json[ 'concepts' ][ k ]);

				s += json[ 'concepts' ][ k ].text + "<br />";
				s += json[ 'concepts' ][ k ].dbpedia + "<br />";
				s += json[ 'concepts' ][ k ].freebase + "<br />";
				s += json[ 'concepts' ][ k ].yago + "<br />";
				s += "<br />";
			}

			document.getElementById("concepts").innerHTML = s;			
		}

		function processName (data) {
			var json = JSON.parse(data);
			var names = new Array();
			
			var s = new String();
			for (var k in json[ 'entities' ]) {
				names.push(json[ 'entities' ][ k ]);

				s += json[ 'entities' ][ k ].type + ":&nbsp;&nbsp;";
				s += json[ 'entities' ][ k ].text + "<br />";
			}

			document.getElementById("name").innerHTML = s;
		}
	</script>
</body>
</html>
